﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdministratorSite.Master" Inherits="System.Web.Mvc.ViewPage<Cs2102BookingSystem.Models.HOTEL>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	CreateHotel
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script runat="server">
    public void printError(string error_for)
    {
        if(ViewData[error_for]!=null)
        {
            Response.Write(ViewData[error_for]);
        }
    }
    </script>
    <asp:Panel ID="Panel2" runat="server" Height="61px" 
        style="font-size: xx-large; font-weight: 700; font-family: Calibri">
        <b>Create Hotel</b></asp:Panel>

    <% using (Html.BeginForm("../AdminCreate/createHotel", 
                             "", 
                             FormMethod.Post, 
                             new Dictionary <string, object> { {"enctype", "multipart/form-data" } }) ) {%>
        <%: Html.ValidationSummary(true) %>
            <fieldset>
            <legend>Hotel Information</legend>
            <table>
                <tr>
                    <td colspan="5" style="color:Red"><% printError("ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="HOTEL_NAME">Name</label></td>
                    <td><%: Html.TextBoxFor(model => model.HOTEL_NAME) %></td>
                    <td style="color:Red"><% printError("NAME_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="COUNTRY">Country</label></td>
                    <td><%: Html.TextBoxFor(model => model.COUNTRY)%></td>
                    <td style="color:Red"><% printError("COUNTRY_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="BRANCHNAME">Branch</label></td>
                    <td><%: Html.TextBoxFor(model => model.BRANCHNAME)%></td>
                    <td style="color:Red"><% printError("BRANCHNAME_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="DISTRICT">District</label></td>
                    <td><%: Html.TextBoxFor(model => model.DISTRICT)%></td>
                    <td style="color:Red"><% printError("DISTRICT_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="ADDRESS">Address</label></td>
                    <td><%: Html.TextBoxFor(model => model.ADDRESS)%></td>
                    <td style="color:Red"><% printError("ADDRESS_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="CONTACT">Contact Number</label></td>
                    <td><%: Html.TextBoxFor(model => model.CONTACT)%></td>
                    <td style="color:Red"><% printError("CONTACT_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="SERVICELEVEL">Service Level</label></td>
                    <td><%: Html.DropDownListFor(model => model.SERVICELEVEL, new SelectList( "123456" ))%></td>
                    <td style="color:Red"><% printError("SERVICE_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red"></td>
                    <td style="width: 150px" colspan="2"><label for="file">Image</label></td>
                    <td><input type="file" name="file" /></td>
                    <td style="color:Red"><% printError("IMAGE_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red"></td>
                    <td style="width: 150px" colspan="2"><label for="DESCRIPTION">Description</label></td>
                    <td><%: Html.TextBoxFor(model => model.DESCRIPTION)%></td>
                    <td style="color:Red"><% printError("DESCRIPTION_ERROR"); %></td>
                </tr>
                <tr style="height:50px">
                    <td colspan="3" style="color:Red">* indicates required fields</td>
                </tr>
                <tr>
                    <td colspan="4"><input type="submit" value="Create" /></td>
                </tr>
            </table>
            </fieldset>
        <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

